import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-05-02
 * Time: 16:09
 */
public class Main {
    static int[][] e = new int[101][101];
    static int[] match = new int[101];
    static int[] book = new int[101];
    static int n, m;
    static int sum = 0;
    static Scanner input = new Scanner(System.in);

    public static void main(String[] args) {
        n = input.nextInt();
        m = input.nextInt();
        for (int i = 1; i <= m; i++) {
            int x = input.nextInt();
            int y = input.nextInt();
            e[x][y] = 1;
            e[y][x] = 1;
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                book[j] = 0;
            }
            if (dfs(i)) {
                sum++;
            }
        }
        System.out.print(sum);
    }

    private static boolean dfs(int u) {
        for (int i = 1; i <= n; i++) {
            if (book[i] == 0 && e[u][i] == 1) {
                book[i] = 1;
                if (match[i] == 0 || dfs(match[i])) {
                    match[i] = u;
                    match[u] = i;
                    return true;
                }
            }
        }
        return false;
    }
}

